﻿/*********************************************
* 命名空间: DataCode.DatabaseDrives.RedisProvide
* 功 能： N/A
* 类 名： RedisModule
* 作 者:  东腾
* 时 间： 2018/3/8 13:50:35 
**********************************************
*/
using System;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Abp.Modules;
using Abp.Runtime.Caching.Redis;
using Castle.MicroKernel.Registration;
using NHibernate.Cfg;

namespace DataCode.DatabaseDrives.RedisProvide
{
    [DependsOn(typeof(AbpRedisCacheModule))]
    public class RedisModule:AbpModule
    {
        //配置缓存
        public override void PreInitialize()
        {

            Configuration.Caching.UseRedis();
            //配置redis 路径
            Configuration.Caching.ConfigureAll( a =>
            {
                a.DefaultSlidingExpireTime=TimeSpan.MaxValue;
            });
            base.PreInitialize();

        }

        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());

        }
    }
}
